package com.example.zhaohang.zhuce;

import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;

import com.example.zhaohang.bingzhuangtu.BaseActivity;
import com.example.zhaohang.bingzhuangtu.LoginActivity;
import com.example.zhaohang.bingzhuangtu.R;


public class Register extends BaseActivity {

    private Button mButton;
    private Button mButton1;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        //沉侵式状态栏
        if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            Window window = getWindow();
            window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS
                    | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
            window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                    | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
            window.setStatusBarColor(Color.TRANSPARENT);
        }


        setContentView(R.layout.activity_register);

        mButton = (Button) findViewById(R.id.register_begin);

        final EditText name = (EditText) findViewById(R.id.register_name);
        final EditText psd = (EditText) findViewById(R.id.register_passworld);
        mButton1 = (Button) findViewById(R.id.register_fogot);


        mButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String trim = name.getText().toString().trim();
                String trim1 = psd.getText().toString().trim();
                if (trim.equals("text")&&trim1.equals("123")){
                    StartActivity(LoginActivity.class,true);
                }

            }
        });
        mButton1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                StartActivity(LoginActivity.class,false);
            }
        });
    }
}
